home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Headers / misckit / miscgiskit / MiscUTMConstants.h < prev    next >
Encoding:
Text File  |  1995-07-21  |  2.3 KB  |  79 lines

  1. /*=========================== MiscUTMConstants.h ============================*/
  2. /* MiscUTMConstants class contains and supports the constants required for
  3.    calculating a Universal Transverse Mercator grid point.
  4.  
  5.    Note that they are made public for the sake of efficient calculation.
  6.    This also introduces a violation of Object security and should be
  7.    handled very carefully.
  8.  
  9.    Subclassing this is a simple way to create constants objects for any Grid.
  10.    Make sure there is only one instance in the system and protect it from 
  11.    deletion by overriding free.
  12.  
  13.    DMA Release 0.8, Copyright @1993 by Genesis Project, Ltd. All Rights
  14.    Reserved. For further information on terms and conditions see
  15.         the MiscKit license.
  16.  
  17. HISTORY
  18. 22-Feb-93  Dale Amon at GPL
  19.        Created.
  20. */
  21.  
  22. #import <appkit/appkit.h>
  23. #import <misckit/miscgiskit.h>
  24.  
  25. #define    MISC_CONVERGENCE_CRITERIA .0001    /* stop at .1 mm difference,
  26.                        so we will be accurate at least
  27.                        to 1mm */
  28. #define    MISC_UTM_CONSTANTS_VERSION_ID    0.8
  29.  
  30. @interface MiscUTMConstants:Object
  31. { /* primary constants */
  32.     const char* gridName;    /* name of the UTM Grid this represents */
  33.  
  34.     double    a,b;        /* Spheroid major and minor semi-axis */
  35.     double    F0;        /* scale factor at central Meridian */
  36.  
  37. @public
  38. /* primary constants */
  39.     double    phi0,lambda0;    /* True Origin in World system */
  40.     double    E0,N0;        /* True Origin in local grid coordinates
  41.                    meters offset from False Origin */
  42.     double convergence;    /* The criteria for convergence */
  43.  
  44. /* secondary constants that are pre-calculated from primary constants */
  45.     double    aF0;        /* a * F0 */
  46.     double    bF0;        /* b * F0 */
  47.     double    eSqrd;        /* eccentricity squared */
  48.     double    n;        
  49.     double  M1;        /* constant 1 in M equation */
  50.     double  M2;        /* constant 2 in M equation */
  51.     double  M3;        /* constant 3 in M equation */
  52.     double  M4;        /* constant 4 in M equation */
  53.  
  54. @private
  55.     BOOL    noFree;        /* If set, this object cannot be free'd */
  56. }
  57.  
  58. + initialize;
  59.  
  60. - initGridName:   (const char *) name
  61.     trueOrigin: (double) deg_latitude : (double) deg_longitude
  62.         inGrid: (double) e0:  (double) n0
  63.       onSphere: (double) a0:  (double) b0
  64.       centralMeridianScaling: (double) f0;
  65.  
  66. - override_eSqrd:(double)new_eSqrd n: (double)new_n;
  67.  
  68. - setProtected;
  69. - setUnprotected;
  70. - free;
  71.  
  72. - (const char *) gridName;
  73. - (BOOL) isEqual: anObject;
  74.  
  75. - write:(NXTypedStream *)stream;
  76. - read: (NXTypedStream *)stream;
  77.  
  78. @end
  79.